﻿using Andong.Model;
using LeederSerialPort;
using NewAndong.Handle;
using NewAndong.Model;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using TitaniumAS.Opc.Client.Da;

namespace NewAndong.Comm
{
    /// <summary>
    /// 用户全局变量
    /// </summary>
    public class GolbalVariable
    {
        /// <summary>
        /// 物料集合
        /// </summary>
        public static ConcurrentBag<MaterialDirectionModel> MaterialDirectionBag { get; set; }

        /// <summary>
        /// 信号灯集合
        /// </summary>
        public static ConcurrentBag<SignalLampDirectionModel> SignalLampDirectionBag { get; set; }

        /// <summary>
        /// 信号灯闪烁线程集合
        /// </summary>
        public static ConcurrentDictionary<string,Thread> SignalLampBlinkThreadDictionary { get; set; }

        /// <summary>
        /// 拉绳灯显示集合
        /// </summary>
        public static ConcurrentBag<SignalLampShowModel> SignalLampShowModelBag { get; set; }

        /// <summary>
        /// 开捆实体集合
        /// </summary>
        public static ConcurrentBag<UnpackingDirectionModel> UnpackingDirectionBag { get; set; }

        /// <summary>
        /// 顺引设置实体集合
        /// </summary>
        public static ConcurrentBag<DirectQuoteModel> DirectQuoteSettingBag { get; set; }

        /// <summary>
        /// 开捆model集合
        /// </summary>
        public static ConcurrentBag<UnpackingDirectionShowModel> UnpackingDirectionModelBag { get; set; }

        /// <summary>
        /// 设备集合
        /// </summary>
        public static ConcurrentBag<SystemDeviceModel> SystemDeviceBag { get; set; }

        /// <summary>
        /// OPC信号集合
        /// </summary>
        public static ConcurrentBag<OpcTagModel> OpcTagBag { get; set; }

        /// <summary>
        /// opc操作类
        /// </summary>
        public static OpcHelper OpcHelper { get; set; }

        /// <summary>
        /// OPC组对象集合
        /// </summary>
        public static List<OpcDaGroup> OpcDaGroupList { get; set; }

        /// <summary>
        /// OPC组实体集合
        /// </summary>
        public static List<OpcGroupModel> opcGroupList { get; set; }

        /// <summary>
        /// 串口配置
        /// </summary>
        public static CurrentParameter CurrentParamet { get; set; }

        /// <summary>
        /// 串口配置实体
        /// </summary>
        public static SerialPortConfModel SerialPortConf { get; set; }
        /// <summary>
        /// UPS实时状态缓存
        /// </summary>
        public static UpsModel UpsStatus { get; set; }
        /// <summary>
        /// plc实时连接状态缓存 
        /// </summary>
        public static bool PlcState { get; set; }
        /// <summary>
        /// lip实时连接状态缓存
        /// </summary>
        public static bool LipState { get; set; }
        /// <summary>
        /// pics实时连接状态缓存
        /// </summary>
        //public static bool PicsState { get; set; }
        /// <summary>
        /// 丰田工机数据集合
        /// </summary>
        public static List<TriaModel> PlcTriaList { get; set; }
        /// <summary>
        /// 丰田工机连接对象集合
        /// </summary>
        public static List<TriaConnectModel> TriaConnectList { get; set; }
        /// <summary>
        /// 丰田工机组集合
        /// </summary>
        public static List<TriaGroupModel> TriaGroupList { get; set; }
        /// <summary>
        /// 丰田工机项集合
        /// </summary>
        public static List<TriaItemModel> TriaItemList { get; set; }
        /// <summary>
        /// 信号灯映射集合
        /// </summary>
        public static List<SignalLampMappingModel> SignalLampMappingList { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public static ConcurrentQueue<PicsQueueModel> PicsQueue { get; set; }
        /// <summary>
        /// Redis集合
        /// </summary>
        //public static ConcurrentBag<AnDongRedisModel> AnDongRedisBag { get; set; }

        /// <summary>
        /// 多少秒内不处理
        /// </summary>
        public static int TimeOut { get; set; }

    }
}
